.alchemy-image-overlay-container,
.alchemy-dialog-container {
  position: fixed;
  overflow: auto;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  @include transition(opacity 200ms linear);

  // vertical aligment
  &:before {
    content: '';
    width: 0;
    height: 100%;
    display: inline-block;
    vertical-align: middle;
    margin-right: -0.25em;
  }

  &.open {
    opacity: 1;
  }
}

.alchemy-image-overlay,
.alchemy-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.0);
  @include transition(background-color 200ms linear);

  &.closable {
    cursor: pointer;
  }
}

.alchemy-dialog-overlay {

  &.open {
    background-color: rgba(0, 0, 0, 0.4);
  }
}

.alchemy-dialog,
.alchemy-image-overlay-dialog {
  position: relative;
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  text-align: left;
}

.alchemy-dialog {
  white-space: normal;
  background-color: $light-gray;
  margin: 2*$default-margin;
  @include border-top-radius($default-border-radius);
  box-shadow: 0 0 2px rgba(#000,0.8);
  @include transition(min-height 200ms ease-in-out);

  &.modal {
    box-shadow: 0 0 4px #666;
  }

  div#jscropper {
    padding: 2 * $default-padding;

    .thumbnail_background {
      @extend %thumbnail-background;
      width: 800px;
      height: 600px;
      position: relative;
    }

    .info.message {
      float: right;
      width: 134px;
      margin: 0 0 0 8px;
      padding: 0 8px 0 32px;
    }

    .jcrop-holder {
      display: inline-block;
    }

    img {
      width: auto;
      max-height: 600px;
    }

    .spinner {
      left: 50% !important;
    }

    form {
      padding: 0;
      position: absolute;
      bottom: 2 * $default-padding;
      right: 2 * $default-padding;
      width: 176px;
      margin-left: 8px;

      .reset_mask, button {
        display: block;
        margin-bottom: 0;
        text-align: center;
      }

      .reset_mask { padding-top: 4px }

      button { width: 100% }
    }
  }
}

.alchemy-dialog-header {
  box-sizing: border-box;
  position: relative;
  height: $dialog-header-height;
  padding: 0 2*$default-padding;
  line-height: $dialog-header-height;
  background: $header-color;
  color: $header-text-color;
  font-weight: normal;
  font-size: $header-font-size;
  @include border-top-radius($default-border-radius);

  .ui-draggable & {
    cursor: move;
  }
}

.alchemy-dialog-title {
  font-weight: bold;
  padding: 0 $default-padding;
  margin-right: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alchemy-image-overlay-close,
.alchemy-dialog-close {
  position: absolute;
  z-index: 1;
  cursor: pointer;

  .icon.close.small {
    line-height: 1;
    vertical-align: text-top;
  }
}

.alchemy-dialog-close {
  top: 0;
  right: 2*$default-padding;
  padding: 0 $default-padding;
  color: inherit;

  .icon.close.small {
    font-size: 16px;
  }
}

.alchemy-dialog-body {
  box-sizing: border-box;
  position: relative;
  color: $text-color;

  .message {
    margin: 8px;
  }

  &.padded {
    padding: 4*$default-padding;

    .message {
      margin: 0 0 8px 0;
    }
  }

  ul#sitemap ul li span.sitemap_sitename {

    &.selected_page a {
      font-weight: bold;
      padding-left: 4px;
    }

    a:hover {
      font-weight: bold;
    }
  }

  .buttons {
    text-align: right;

    label {
      float: left;
      margin-top: 12px;
    }
  }
}

.alchemy-dialog-buttons {
  box-sizing: border-box;
  float: left;
  clear: both;
  width: 100%;
  padding: 4*$default-padding 0;
  text-align: right;

  button:first-child {
    margin-right: 2*$default-margin;
  }
}

#overlay_tabs {
  margin: -4*$default-padding;

  .ui-tabs-panel {
    padding: 4*$default-padding;
  }
}
